package cn.shiwei.org.quartz;

import cn.shiwei.org.BaseTest;
import cn.shiwei.quartz.job.PrintTimeJob;
import cn.shiwei.quartz.util.QuartzUtil;
import cn.shiwei.shopcart.domain.ShopCart;
import cn.shiwei.shopcart.mapper.ShopCartMapper;
import org.apache.commons.lang3.time.DateUtils;
import org.junit.Test;
import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class Dome extends BaseTest {

    @Autowired
    private Scheduler scheduler;
    @Autowired
    private ShopCartMapper shopCartMapper;
/*    @Test
    public void addJob() throws InterruptedException {
        Date date = DateUtils.addSeconds(new Date(), 5);
        QuartzUtil.addJob(
                scheduler, // 定时任务容器
                "定时任务1", // 定时任务名称
                PrintTimeJob.class, // 业务类
                "参数",
                date);

        QuartzUtil.addJob(
                scheduler, // 定时任务容器
                "定时任务9", // 定时任务名称
                PrintTimeJob.class, // 业务类
                "参数",
                "5/3 * * * * ? ");

        Thread.sleep(600000);
    }*/
    @Test
    public void test(){
        System.out.println(shopCartMapper.loadAll());
    }

}
